C     POMSTR.F        Auxiliary subroutines
C     Copyright (C) 1997  Filip Hroch, Masaryk University, Brno, CZ
C
C     This program is free software; you can redistribute it and/or modify
C     it under the terms of the GNU General Public License as published by
C     the Free Software Foundation; either version 2 of the License, or
C     (at your option) any later version.
C
C     This program is distributed in the hope that it will be useful,
C     but WITHOUT ANY WARRANTY; without even the implied warranty of
C     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
C     GNU General Public License for more details.
C
C     You should have received a copy of the GNU General Public License
C     along with this program; if not, write to the Free Software
C     Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
C
C    E-mail: hroch@physics.muni.cz
C    Web:    http://www.sci.muni.cz/~hroch/index.html
C    Postal address: F.Hroch
C                    Department of Theoretical Physics and Astrophysics
C                    Masaryk University
C                    Kotlarska 2
C                    611 37 Brno
C                    Czech Republic


CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

      INTEGER FUNCTION LN(A)
C Length of A (ignore spaces ' ')
      CHARACTER*(*) A
      INTEGER I

      DO I = LEN(A),1,-1
        IF( A(I:I).NE.' ')THEN
          LN = I
          RETURN
        ENDIF
      ENDDO
      LN = 0
      END

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC

      SUBROUTINE CTOF(A,B)
      CHARACTER*(*) A,B
C Convert C strings to Fortran strings
      INTEGER I
      LOGICAL NULL

      NULL = .FALSE.
      DO I = 1,LEN(A)
        IF( .NOT.NULL .AND. A(I:I) .LT. ' ' ) NULL = .TRUE.
        IF( NULL )THEN
          B(I:I) = ' '
        ELSE
          B(I:I) = A(I:I)
        ENDIF
      ENDDO
      END

CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
